package com.rpay.web.service;
/**
 * @author XXX
 * @mail XXX@hotmail.com
 * @date 2018/5/7
 * @Description: 
*/
import com.rpay.common.dto.news.NewsDTO;
import com.rpay.common.dto.news.SqlQueryDTO;
import com.rpay.service.news.INewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NewsService {
    @Autowired
    private INewsService iNewsService;

    public SqlQueryDTO data(String newsType, Integer page, Integer pageSize) {
        SqlQueryDTO query = new SqlQueryDTO();
        query.setVisible(1);
        query.setNewsType(newsType);
        query.setPage((page - 1) * pageSize);
        query.setPageSize(pageSize);
        SqlQueryDTO data = iNewsService.getDataList(query, page, pageSize);
        return data;
    }

    public NewsDTO detail(Integer id) {
        NewsDTO query=new NewsDTO();
        query.setId(id);
        query.setVisible(1);
        NewsDTO detail = iNewsService.getDetail(query);
        return detail;
    }
}
